FileIn "UABFuncions.ms"
FileIn "Exportador.ms"
utility UABUtility "UAB Utility" width:156 height:400
(
	button setPathButton "Set path" pos:[20,11] width:128 height:20 -- done
 -- done
	label PathLabel "D:\\Proyectos c++\Videogame\\UABVideojocs\\Bin\\TestProcess\\data" pos:[20,40] width:128 height:48 --done
 --done
	checkbox ExportMeshCheck "Export Mesh" pos:[16,96] width:132 height:16 
 
	checkbox CopyTexturesCheck "Copy Textures" pos:[16,116] width:132 height:16
	combobox LevelList "ComboBox" pos:[12,140] width:136 height:2 --semidone
 --semidone
	GroupBox grp1 "Export" pos:[12,196] width:136 height:132 
 
	button MeshButton "Mesh" pos:[88,212] width:56 height:24
	-- Contenido de la utility
	button LightsButton "Lights" pos:[16,212] width:48 height:24
	button CameraButton "Camera" pos:[16,240] width:48 height:24
	button StaticMeshManagerButton "StaticMeshManager" pos:[16,268] width:128 height:24
	button SceneButton "Scene" pos:[16,300] width:128 height:24




	on UABUtility open do
	(
		--	PathLabel.text = "C:\\exports"
			local levels=#("","level 1","level 2", "level 3","level 4", "main menu", "select player")
			LevelList.items=levels
	)
	on setPathButton pressed do
	(
		local data_path = getSavePath caption: "Set data path" InitialDir:PathLabel.text
		if data_path!=undedfined then 
		(
			PathLabel.text=data_path
		)
	)
	on MeshButton pressed do
	(
		ExportMeshPressed PathLabel.text CopyTexturesCheck.Checked
	)
	on StaticMeshManagerButton pressed do
	(
		local Cores=#()
		local InstancesByCores=#()
		local Instances=#()
		GetCoreInstance $* Cores InstancesByCores Instances
		StaticMeshManager Cores PathLabel.text LevelName ExportMeshCheck.Checked CopyTexturesCheck.Checked
		-- Este no se si hay que hacer-lo tambien aqui
		RenderableObjectManager PathLabel.text Cores InstancesByCores Instances
	)
	on SceneButton pressed do
	(
		local Cores=#()
		local InstancesByCores=#()
		local Instances=#()
		GetCoreInstance $* Cores InstancesByCores Instances
		StaticMeshManager Cores PathLabel.text LevelName ExportMeshCheck.Checked CopyTexturesCheck.Checked
		RenderableObjectManager PathLabel.text Cores InstancesByCores Instances
		
	)
)
